package net.chery;

import net.chery.entity.VehProduce;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

/**
 * @author gai
 */
public abstract class Cons {
    private Cons(){}
    public static final String SH="沪";

    public static final String YES="1";
    public static final String NO="0";
    public static final String EH="EH";
    public static final int VIN_LENGTH=17;

    public static  <T> Map<String, T> mapObject(List<T> list, Function<T, String> function) {
        Map<String, T> map = new HashMap<>(128);
        if (list == null || list.isEmpty()) {
            return map;
        }
        list.forEach(v -> {
            map.put(function.apply(v), v);
        });
        return map;
    }
}
